{extend name='common/_container'}
{block name="content"}
<div class="ibox float-e-margins">
<input type="hidden" name='id' id='id' value="{$info.id}" />
	<div class="ibox-content">
		<div class="form-horizontal" id="CodeInfoForm">
			<div class="row">
				<div class="col-sm-12">
				<!-- form start -->
					<div class="form-group">
						<label class="col-sm-2 control-label">名称：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="title" value="{$info.title}" name="text" class="form-control" placeholder="请输入名称"  >
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">排序：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="sort" value="{$info.sort}" name="sort" class="form-control" placeholder="请输入排序"  >
						</div>
					</div>

					<div class="form-group">
						<label class="col-sm-2 control-label">图标：</label>
						<div class="col-sm-6">
							<input type="text" autocomplete="off" id="image" value="{$info.image}" {if condition="config('my.img_show_status') eq true"}onmousemove="showBigPic(this.value)" onmouseout="closeimg()"{/if} name="image" class="form-control" placeholder="请输入礼物图片">
							<span class="help-block m-b-none image_process"></span>
						</div>
						<div class="col-sm-2" style="position:relative; right:30px;">
							<span id="image_upload"></span>
						</div>
					</div>



					<!-- form end -->
				</div>
			</div>
			<div class="hr-line-dashed"></div>
			<div class="row btn-group-m-t">
				<div class="col-sm-9 col-sm-offset-1">
					<button type="button" class="btn btn-primary" onclick="CodeInfoDlg.update()" id="ensure">
						<i class="fa fa-check"></i>&nbsp;确认提交
					</button>
					<button type="button" class="btn btn-danger" onclick="CodeInfoDlg.close()" id="cancel">
						<i class="fa fa-eraser"></i>&nbsp;取消
					</button>
				</div>
			</div>
		</div>
	</div>
</div>
<script src="__PUBLIC__/static/js/upload.js" charset="utf-8"></script>
<script src="__PUBLIC__/static/js/plugins/layui/layui.js" charset="utf-8"></script>
<script>
layui.use(['form'],function(){});
uploader('image_upload','image','image',false,'','{:getUploadServerUrl()}');
var CodeInfoDlg = {
	CodeInfoData: {},
	validateFields: {
	 }
}

CodeInfoDlg.collectData = function () {
	this.set('title').set('id').set('sort').set('image');
};
CodeInfoDlg.update = function () {
	this.clearData();
	this.collectData();
	if (!this.validate()) {
		return;
	}
	var ajax = new $ax(Feng.ctxPath + "/ZhMatchmakerLevelInterest/update", function (data) {
		if ('00' === data.status) {
			Feng.success(data.msg,1000);
			window.parent.CodeGoods.table.refresh();
			CodeInfoDlg.close();
		} else {
			Feng.error(data.msg + "！",1000);
		}
	})
	ajax.set('status',status);
	ajax.set(this.CodeInfoData);
	ajax.start();
};

</script>
<script src="__PUBLIC__/static/js/base.js" charset="utf-8"></script>
{/block}
